package com.example.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.alibaba.fastjson.JSON;
import com.example.mapper.TestMapper;
import com.example.model.TestModel;

@Service
public class TestService {
   
	@Autowired
	private TestMapper testMapper;
	
	@Transactional
	public String getTestInfo() {
		TestModel info = testMapper.getById(1);
		System.out.println(JSON.toJSONString(info));
		return JSON.toJSONString(info);
	}
	
	public List<TestModel> listAll(){
		return testMapper.listAll();
	}
	
}
